package com.rjxy.plansystemmanagement.mapper;


import com.rjxy.plansystemmanagement.entity.RoomInformation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoomMapper {

    @Select("select * from RoomInformation")
    List<RoomInformation> list();

    @Delete("delete from RoomInformation where ID = #{ID}")
    void deleteRoom(Integer ID);

    @Insert("insert into RoomInformation(RoomNum,HotelId,RZTime,TFTime,RoomType,BreakFast,Price,status)" +
    "VALUES (#{RoomNum},#{HotelId},#{RZTime},#{TFTime},#{RoomType},#{BreakFast},#{Price},#{status})")
    void addRoom(RoomInformation roomInformation);

    @Select("select * from RoomInformation where ID = #{ID}")
    RoomInformation getRoomById(Integer ID);

    @Select("select * from RoomInformation where hotelId = #{id}")
    List<RoomInformation> getRoomByHotelId(Integer id);

    void updateRoom(RoomInformation roomInformation);
}
